package com.example.neo4jdemo.controller;

import com.example.neo4jdemo.entity.UserEntity;
import com.example.neo4jdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping("/addUser")
    public String addUserNode(){
        UserEntity userEntity = new UserEntity();
        userEntity.setName("张三");
        userEntity.setAge(20);
        userService.addUser(userEntity);
        return "success";
    }
}
